package com.atguigu.gmall.order.service;

import com.atguigu.gmall.model.enums.ProcessStatus;
import com.atguigu.gmall.model.order.OrderInfo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Map;

/**
 * 订单相关逻辑服务接口类
 */
public interface OrderService extends IService<OrderInfo> {
    /**
     * 保存订单
     * @param orderInfo
     * @return
     */
    public  OrderInfo addOrderInfo(OrderInfo orderInfo);

    /**
     * 根据订单Id 修改订单的状态
     * @param orderId
     * @param processStatus
     */
    void execExpiredOrder(Long orderId, ProcessStatus processStatus);

    /**
     * 查询订单详情
     * @param id
     * @return
     */
    public OrderInfo getById(Long id);

    /**
     * 支付成功
     * @param map
     * @return
     */
    public Integer paySuccess(Map<String,String> map,Integer channel);

    /**
     * 支付失败
     * @param map
     * @return
     */
    public Integer payFail(Map<String,String> map);
    /**
     * 取消订单
     * @param orderId
     */
    public void cancleOrder(Long orderId);
}
